# -------------------------------------------------
# Project created by QtCreator 2010-06-30T11:03:08
# -------------------------------------------------
TARGET = SAPoCaPT
TEMPLATE = app
SOURCES += main.cpp \
    gui_map_of_property.cpp \
    gui_map_of_quality.cpp \
    gui_map_of_potencial.cpp \
    map_of_quality.cpp \
    map_of_property.cpp \
    map_of_potencial.cpp \
    file_reader.cpp \
    inverse_square_distance.cpp \
    kriging.cpp \
    plot.cpp \
    map_data_control.cpp \
    gui_mainwindow.cpp \
    fuzzy_graph.cpp \
    gui_fuzzy_config.cpp \
    fuzzy.cpp \
    fuzzy_input.cpp \
    fuzzy_output.cpp \
    fuzzy_rules.cpp \
    distances.cpp \
    semivariogram.cpp \
    points.cpp \
    modeloteorico.cpp \
    matrix.cpp \
    abscissasemivariogram.cpp \
    histogram.cpp \
    lagrangeinterpolator.cpp \
    syntheticsemivariogram.cpp \
    kriging_serial.cu \
    kriging_parallel.cu \
    kriging_aux_kernels.cu \
    kriging_aux.cu \
    kriging_management.cpp

SOURCES -= kriging_aux.cu  kriging_aux_kernels.cu  kriging_parallel.cu  kriging_serial.cu #gancho para os arquivos aparecerem no editor

HEADERS += gui_map_of_property.h \
    gui_map_of_quality.h \
    gui_map_of_potencial.h \
    map_of_quality.h \
    map_of_property.h \
    map_of_potencial.h \
    file_reader.h \
    interpolation_algorithm.h \
    inverse_square_distance.h \
    kriging.h \
    plot.h \
    point.h \
    map_data_control.h \
    spectrogram_data.h \
    gui_mainwindow.h \
    fuzzy_graph.h \
    gui_fuzzy_config.h \
    fuzzy.h \
    fuzzy_input.h \
    fuzzy_output.h \
    fuzzy_rules.h \
    distances.h \
    semivariogram.h \
    points.h \
    modeloteorico.h \
    matrix.h \
    abscissasemivariogram.h \
    histogram.h \
    lagrangeinterpolator.h \
    syntheticsemivariogram.h \
    kriging_serial.h \
    kriging_parallel.h \
    kriging_aux_kernels.h \
    kriging_aux.h \
    kriging_management.h

######################################CUDA#######################################
# Cuda sources
CUDA_SOURCES += kriging_aux.cu  kriging_aux_kernels.cu  kriging_parallel.cu  kriging_serial.cu
# Project dir and outputs
PROJECT_DIR = $$system(pwd)
OBJECTS_DIR = $$PROJECT_DIR/Obj
DESTDIR = ../bin

# Path to cuda SDK install
CUDA_SDK = /opt/cuda/sdk/C #(note i'm using a linux machine)
# Path to cuda toolkit install
CUDA_DIR = /opt/cuda
# GPU architecture
CUDA_ARCH = sm_12 #(yep, i've a really old cuda capable graphic card)
# nvcc flags (ptxas option verbose is always useful)
NVCCFLAGS = --compiler-options -fno-strict-aliasing -use_fast_math --ptxas-options=-v
# include paths
INCLUDEPATH += $$CUDA_DIR/include
INCLUDEPATH += $$CUDA_SDK/common/inc/
INCLUDEPATH += $$CUDA_SDK/../shared/inc/
# lib dirs
QMAKE_LIBDIR += $$CUDA_DIR/lib64
QMAKE_LIBDIR += $$CUDA_SDK/lib
QMAKE_LIBDIR += $$CUDA_SDK/common/lib

# libs - note than i'm using a x_86_64 machine
LIBS += -lcudart #-lcutil_x86_64
# join the includes in a line
CUDA_INC = $$join(INCLUDEPATH,' -I','-I',' ')

# Prepare the extra compiler configuration (taken from the nvidia forum - i'm not an expert in this part)
cuda.input = CUDA_SOURCES
cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.o

cuda.commands = $$CUDA_DIR/bin/nvcc -m64 -g  -arch=$$CUDA_ARCH -c $$NVCCFLAGS $$CUDA_INC $$LIBS  ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}

#cuda.commands = $$CUDA_DIR/bin/nvcc -c  ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}


cuda.dependcy_type = TYPE_C
#
cuda.depend_command = $$CUDA_DIR/bin/nvcc -g -M $$CUDA_INC $$NVCCFLAGS   ${QMAKE_FILE_NAME}
#cuda.depend_command = $$CUDA_DIR/bin/nvcc -M  ${QMAKE_FILE_NAME}
# Tell Qt that we want add more stuff to the Makefile
QMAKE_EXTRA_COMPILERS += cuda

######################################CUDA#######################################

#QMAKE_CXXFLAGS += -O2 -pipe -march=native -msse4.1

#QMAKE_CXXFLAGS += -pipe -march=native -msse4.1
#gentoo
QWT_ROOT = //usr//include//qwt5
INCLUDEPATH += $${QWT_ROOT}
QWTLIB = qwt$${SUFFIX_STR}
LIBS += -L$${QWT_ROOT}/lib \
    -l$${QWTLIB}
RESOURCES += gui.qrc

#ubuntu
#QWT_ROOT = /usr/include/qwt-qt4/
#INCLUDEPATH += $${QWT_ROOT}
#QWTLIB = qwt$${SUFFIX_STR}
#LIBS += /usr/lib/libqwt-qt4.so
#RESOURCES += gui.qrc
